home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / basic / pbasmlib.zip / PBADEMO3.BAS < prev    next >
BASIC Source File  |  1994-02-12  |  1KB  |  40 lines

  1. $string 32
  2. $link "pbasmlib.pbl"
  3. $include "pbasmlib.inc"
  4.  
  5.  
  6. 'PBASMLIB Sound Module Demo of SBPLAYFILE and SBPLAYSTRING -
  7. 'playback of digitized sample data - requires RIFF.RAW, a raw
  8. 'sample file included with PBASMLIB.
  9. '
  10. 'Note: If you can't get this to make any sound, you may need
  11. 'to change the SB's base port setting (default=220h).  To do
  12. 'this, use SBSETBASE &h240, or whatever the base port setting is.
  13.  
  14. wr$="riff.raw"
  15. if dir$(wr$)="" then
  16.     line input "Path to riff.raw: ";pth$
  17.      if right$(pth$,1)<>"\" then pth$=pth$+"\"
  18.      wr$=pth$+wr$
  19. end if
  20.  
  21. sbreset
  22. for t%=35 to 20 step -5
  23. sbplayfile wr$,t%         'Play the entire file at varying speeds
  24. sbdelay 200
  25. next t%
  26. if dir$(wr$)="" then end  'Quit if file not found
  27. open "b",#1,wr$           'Open file for binary access
  28. get$ 1,400,a$             'Throw away first 400 bytes
  29. get$ 1,3000,a$            'Get 3000 byte portion
  30. seek 1,1
  31. get$ 1,18250,b$           'Get 18K portion
  32. close 1
  33. for t%=1 to 4
  34. sbplaystring a$,15        'Play 3000-byte portion 4 times
  35. next t%
  36. sbplayfile wr$,15         'Play the entire file again
  37. sbdelay 100
  38. sbplaystring b$,15        'Play the 18K portion twice
  39. sbdelay 150
  40. sbplaystring b$,15